Optimal. Leaf size=460 \[ \frac {2 i f^2 \sqrt {a^2-b^2} \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^3}-\frac {2 i f^2 \sqrt {a^2-b^2} \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^3}+\frac {2 f \sqrt {a^2-b^2} (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 f \sqrt {a^2-b^2} (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^2}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^2 d}+\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f^2 \cos (c+d x)}{b d^3}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}+\frac {(e+f x)^2 \cos (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.93, antiderivative size = 460, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 10, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {4525, 32, 3296, 2638, 3323, 2264, 2190, 2531, 2282, 6589} \[ \frac {2 f \sqrt {a^2-b^2} (e+f x) \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 f \sqrt {a^2-b^2} (e+f x) \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^2 d^2}+\frac {2 i f^2 \sqrt {a^2-b^2} \text {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^3}-\frac {2 i f^2 \sqrt {a^2-b^2} \text {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^2 d^3}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^2 d}+\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}-\frac {2 f^2 \cos (c+d x)}{b d^3}+\frac {(e+f x)^2 \cos (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 2190
Rule 2264
Rule 2282
Rule 2531
Rule 2638
Rule 3296
Rule 3323
Rule 4525
Rule 6589
Rubi steps
\begin {align*} \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {a \int (e+f x)^2 \, dx}{b^2}-\frac {\int (e+f x)^2 \sin (c+d x) \, dx}{b}-\frac {\left (a^2-b^2\right ) \int \frac {(e+f x)^2}{a+b \sin (c+d x)} \, dx}{b^2}\\ &=\frac {a (e+f x)^3}{3 b^2 f}+\frac {(e+f x)^2 \cos (c+d x)}{b d}-\frac {\left (2 \left (a^2-b^2\right )\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{b^2}-\frac {(2 f) \int (e+f x) \cos (c+d x) \, dx}{b d}\\ &=\frac {a (e+f x)^3}{3 b^2 f}+\frac {(e+f x)^2 \cos (c+d x)}{b d}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}+\frac {\left (2 i \sqrt {a^2-b^2}\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b}-\frac {\left (2 i \sqrt {a^2-b^2}\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b}+\frac {\left (2 f^2\right ) \int \sin (c+d x) \, dx}{b d^2}\\ &=\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f^2 \cos (c+d x)}{b d^3}+\frac {(e+f x)^2 \cos (c+d x)}{b d}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}-\frac {\left (2 i \sqrt {a^2-b^2} f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 d}+\frac {\left (2 i \sqrt {a^2-b^2} f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 d}\\ &=\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f^2 \cos (c+d x)}{b d^3}+\frac {(e+f x)^2 \cos (c+d x)}{b d}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d}+\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}-\frac {\left (2 \sqrt {a^2-b^2} f^2\right ) \int \text {Li}_2\left (\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 d^2}+\frac {\left (2 \sqrt {a^2-b^2} f^2\right ) \int \text {Li}_2\left (\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^2 d^2}\\ &=\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f^2 \cos (c+d x)}{b d^3}+\frac {(e+f x)^2 \cos (c+d x)}{b d}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d}+\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}+\frac {\left (2 i \sqrt {a^2-b^2} f^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (\frac {i b x}{a-\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^2 d^3}-\frac {\left (2 i \sqrt {a^2-b^2} f^2\right ) \operatorname {Subst}\left (\int \frac {\text {Li}_2\left (\frac {i b x}{a+\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^2 d^3}\\ &=\frac {a (e+f x)^3}{3 b^2 f}-\frac {2 f^2 \cos (c+d x)}{b d^3}+\frac {(e+f x)^2 \cos (c+d x)}{b d}+\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d}-\frac {i \sqrt {a^2-b^2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d}+\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^2}-\frac {2 \sqrt {a^2-b^2} f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^2}+\frac {2 i \sqrt {a^2-b^2} f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^2 d^3}-\frac {2 i \sqrt {a^2-b^2} f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^2 d^3}-\frac {2 f (e+f x) \sin (c+d x)}{b d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.64, size = 536, normalized size = 1.17 \[ \frac {\frac {3 i \left (b^2-a^2\right ) \left (-i \left (d^2 \left (2 e^2 \sqrt {b^2-a^2} \tan ^{-1}\left (\frac {i a+b e^{i (c+d x)}}{\sqrt {a^2-b^2}}\right )+f x \sqrt {a^2-b^2} (2 e+f x) \left (\log \left (1-\frac {b e^{i (c+d x)}}{\sqrt {b^2-a^2}-i a}\right )-\log \left (1+\frac {b e^{i (c+d x)}}{\sqrt {b^2-a^2}+i a}\right )\right )\right )+2 f^2 \sqrt {a^2-b^2} \text {Li}_3\left (\frac {b e^{i (c+d x)}}{\sqrt {b^2-a^2}-i a}\right )-2 f^2 \sqrt {a^2-b^2} \text {Li}_3\left (-\frac {b e^{i (c+d x)}}{i a+\sqrt {b^2-a^2}}\right )\right )-2 d f \sqrt {a^2-b^2} (e+f x) \text {Li}_2\left (\frac {b e^{i (c+d x)}}{\sqrt {b^2-a^2}-i a}\right )+2 d f \sqrt {a^2-b^2} (e+f x) \text {Li}_2\left (-\frac {b e^{i (c+d x)}}{i a+\sqrt {b^2-a^2}}\right )\right )}{d^3 \sqrt {-\left (a^2-b^2\right )^2}}+a x \left (3 e^2+3 e f x+f^2 x^2\right )+\frac {3 b \cos (d x) \left (\cos (c) \left (d^2 (e+f x)^2-2 f^2\right )-2 d f \sin (c) (e+f x)\right )}{d^3}-\frac {3 b \sin (d x) \left (\sin (c) \left (d^2 (e+f x)^2-2 f^2\right )+2 d f \cos (c) (e+f x)\right )}{d^3}}{3 b^2} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [C] time = 0.66, size = 1646, normalized size = 3.58 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (f x + e\right )}^{2} \cos \left (d x + c\right )^{2}}{b \sin \left (d x + c\right ) + a}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.62, size = 0, normalized size = 0.00 \[ \int \frac {\left (f x +e \right )^{2} \left (\cos ^{2}\left (d x +c \right )\right )}{a +b \sin \left (d x +c \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F(-1)] time = 0.00, size = -1, normalized size = -0.00 \[ \text {Hanged} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________